<template>
	<!--
    	作者：1550495493@qq.com
    	时间：2019-08-17
    	描述：我的评审
    -->
	<div class="Announcements">
		<div class="Website-visits">
			<div class="location">
				<div class="location-text fl">
					<img class="location-img fl" src="../../images/BaseManager/MyReview.png" />
					<p class="fr">我的评审</p>
				</div>
				<img class="biaotibg fl" src="../../images/home/biaotibg.png" />
			</div>
			<div class="search-box">
				<div class="fl">
					<label>项目检索：</label>
          <input name="search" class="search" type="text" autocomplete="off" v-model="search" />
          <input class="btn" type="button" value="搜索" @click="searchTodo" />
				</div>
			</div>
			<div class="PressRelease-list">
				<table>
					<thead>
						<tr>
							<th class="w200">项目名称</th>
							<th class="w200">发布基地</th>
							<th class="w100">发布时间</th>
							<th class="w100">项目类型</th>
							<th class="w80">评审事宜</th>
              <th class="w100">是否二次评审</th>
              <!--<th class="w200">评审截止时间</th>-->
							<th class="w80">评审状态</th>
              <th class="w80">项目状态</th>
              <th class="w80">操作</th>
            </tr>
					</thead>
					<tbody>
          <tr v-if="reviewerExpertList.length == 0">
            <td colspan="10" class="center">暂无数据！</td>
          </tr>
          <tr v-for="(reviewerExpert,index) in reviewerExpertList" :class="index==curIndex?'activeBg':''" @click="choosed(index)">
							<td :title="reviewerExpert.projectName"><span class="show-twoline">{{reviewerExpert.projectName}}</span></td>
							<td :title="reviewerExpert.areasName"><span class="show-twoline">{{reviewerExpert.areasName}}</span></td>
							<td>{{formatData(reviewerExpert.projectReleaseTime)}}</td>
							<td>{{reviewerExpert.projectType == 0 ? "研究院项目" : "横向项目"}}</td>
							<td>{{reviewerExpert.matters == 0 ? "项目申请" : "项目结题"}}</td>
              <td>{{reviewerExpert.reviewNum == 2 ? "是" : "否"}}</td>
              <!--<td>{{formatData(reviewerExpert.endTime)}}</td>-->
							<td>{{reviewerExpert.reviewerStatus == 0 ? "未评审" : "已评审"}}</td>
              <td>
                <template v-if="reviewerExpert.areasStatus == 6 || reviewerExpert.areasStatus == 3">
                  无效
                </template>
                <template v-else>
                  <template v-if="reviewerExpert.projectClosureAuditStatus == 2 || reviewerExpert.projectClosureAuditStatus == 3">
                    已结题
                  </template>
                  <template v-else-if="reviewerExpert.projectClosureAuditStatus == 4">
                    限期整改
                  </template>
                  <template v-else>
                    有效
                  </template>
                </template>
              </td>
              <td>
                <!--<template v-if="reviewerExpert.reviewerStatus == 0 && reviewerExpert.optionStatus == 1 && (reviewerExpert.areasStatus == 6 || reviewerExpert.areasStatus == 3 ? false : true)">
                  &lt;!&ndash;项目申请评审&ndash;&gt;
                  <input @click="demand(reviewerExpert)" type="button" value="评审" class="delete write" v-if="reviewerExpert.matters == 0"/>
                  &lt;!&ndash;项目结题评审&ndash;&gt;
                  <input @click="projectDetails(reviewerExpert)" type="button" value="评审" class="delete write" v-else/>
                </template>-->
                <template v-if="reviewerExpert.reviewerStatus == 0 && (reviewerExpert.areasStatus == 6 || reviewerExpert.areasStatus == 3 ? false : true)">
                  <!--项目申请评审-->
                  <!--<input @click="demand(reviewerExpert)" type="button" value="评审" class="delete write" v-if="reviewerExpert.matters == 0"/>-->
                  <input @click="demand(reviewerExpert)" type="button" value="评审" class="delete write" v-if="reviewerExpert.matters == 0 && reviewerExpert.projectInitiationAuditStatus == 1 && reviewerExpert.applicationAuditStatus == 1"/>
                  <!--项目结题评审-->
                  <!--<input @click="projectDetails(reviewerExpert)" type="button" value="评审" class="delete write" v-else/>-->
                  <input @click="projectDetails(reviewerExpert)" type="button" value="评审" class="delete write" v-else-if="reviewerExpert.matters == 1 && reviewerExpert.projectClosureAuditStatus == 1 && reviewerExpert.applicationClosureAuditStatus == 1"/>
                </template>
              </td>
            </tr>
					</tbody>
				</table>

			</div>
			<!--total  数据总数   size  一页多少条数据   page  当前页码    changge 返回当前选择的页码  改变一页显示条 child  返回值就是一页显示条数  -->
				<pageination :total="total" :size="size" :page="page" :changge="pageFn" @child="obtainChild"></pageination>
		</div>
		<!-- 申请专家-模态框-->
		<div v-show="demandModelShow" class="tenant-model">
			<div class="tenant-model-content demandModel">
				<header class="tenant-model-header">
					<h3>{{projectReviewList[0] != null && projectReviewList[0].matters == 1 ? "项目结题评审" : "专家评审"}}</h3>
					<span @click="closeModel" class="closeModel">×</span>
				</header>
				<div class="tenant-model-body">
					<div class="search-contain">
						<!--模态框内容板块-->
						<div class="fr">
							<a @click="preview(projectReviewList[0].standardUrl)" class="attachment">评审标准</a>
							<!--<input @click="rorkRecord" type="button" class="attachment" value="评审标准" />-->
						</div>
						<div class="demandModel-table">
							<table>
								<tr>
									<th>申请专家姓名</th>
									<th>身份证号</th>
									<th>二级学科</th>
									<template v-if="projectReviewList[0] != null && projectReviewList[0].matters == 0">
										<th>申请书</th>
									</template>
									<template v-if="projectReviewList[0] != null && projectReviewList[0].matters == 1">
										<th>任务书</th>
										<th>中期报告</th>
										<th>结题报告</th>
									</template>
									<th>评审</th>
								</tr>
								<tr v-if="!projectReviewList.length">
									<td colspan="5" v-if="projectReviewList[0] != null && projectReviewList[0].matters == 0">暂无数据</td>
									<td colspan="7" v-if="projectReviewList[0] != null && projectReviewList[0].matters == 1">暂无数据</td>
								</tr>
								<tr v-for="(projectReview,index) in projectReviewList">
									<td>{{projectReview.applicationExpertName}}</td>
									<td>{{projectReview.expertTheWork}}</td>
									<td>{{projectReview.expertSecondLevel}}</td>
									<template v-if="projectReview.matters == 0">
										<td>
											<input @click="preview(projectReview.applicationBookUrl)" type="button" value="查看" class="delete write" />
										</td>
									</template>
									<template v-if="projectReview.matters == 1">
										<td>
											<input @click="preview(projectReview.taskBookUrl)" type="button" value="查看" class="delete write" />
										</td>
										<td>
											<input @click="preview(projectReview.metaphaseReportUrl)" type="button" value="查看" class="delete write" />
										</td>
										<td>
											<input @click="preview(projectReview.closureMaterialUrl)" type="button" value="查看" class="delete write" />
										</td>
									</template>
									<td>
										<template v-if="projectReview.type == null || projectReview.type == 0">
											<input name="score" autocomplete="off" v-model="projectReview.score" :class="(projectReview.score<0||projectReview.score>100)?'redBorder':''" onkeyup="value=value.replace(/[^\d.]/g,'')" />
											<!--正则是限定只能输数字-->
										</template>
										<template v-else>
											<label>
											<input :name="'auditStatus' + index" type="radio" value="1" v-model="projectReview.auditStatus" />通过</label>
											<label><input :name="'auditStatus' + index" type="radio"  value="2" v-model="projectReview.auditStatus" />不通过</label>
										</template>
									</td>
								</tr>

							</table>
						</div>
						<div class="center">
							<input @click="defineReviewer" type="button" value="确定" />
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</template>
<script src="./MyReview.js"></script>

<style scoped>
	@import "MyReview.css"
</style>
